<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=yes,minimum-scale=1.0,maximum-scale=1.0"/>
<title>注册</title>
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
	<form name="myForm" ng-app="registerApp"
		ng-controller="registerController" novalidate>
		<div class="container">
			<div class="row clearfix">
				<div class="col-md-4 column"></div>
				<div class="col-md-6 column">
				<div class="container">
					<div class="row clearfix">
						<div class="col-md-1 column">
						</div>
						<div class="col-md-4 column">
							<div class="page-header">
							<h1>&nbsp;&nbsp;注册</h1>
							</div>
						</div>
						<div class="col-md-4 column">
						</div>
					</div>
				</div>
					
				</div>
				<div class="col-md-2 column"></div>
			</div>
			<div class="row clearfix">
				<div class="col-md-4 column"></div>
				<div class="col-md-4 column">
					<div class="row clearfix">
						<div class="col-md-12 column">
							<label for="name">用户名</label>* <input type="text"
								class="form-control" id="name" ng-model="user" name="user"
								ng-minlength="1" placeholder="请输入名称" required> <span
								style="color: red"
								ng-show="myForm.user.$dirty && myForm.user.$invalid"> <span
								ng-show="myForm.user.$error.required">用户名是必须的。</span> <span
								class="warning" ng-show="myForm.user.$error.required">*</span> <span
								class="warning" ng-show="myForm.user.$error.minlength">最少为6位数</span>
							</span>
						</div>
					</div>
					<div class="row clearfix">
						<div class="col-md-12 column">
							<label for="name">密码</label>* <input type="password"
								class="form-control" id="pwd" ng-model="password"
								placeholder="请输入密码" required="required" ng-minlength="1"
								name="pwd" required /> <span style="color: red"
								ng-show="myForm.pwd.$dirty && myForm.pwd.$invalid"> <span
								ng-show="myForm.pwd.$error.required">密码是必须的。</span> <span
								class="warning"
								ng-show="!myForm.pwd.$pristine && myForm.pwd.$error.required">*</span>
								<span class="warning" ng-show="myForm.pwd.$error.minlength">最少为6位数</span>
							</span>
						</div>
					</div>
					<div class="row clearfix">
						<div class="col-md-12 column">
							<label for="name">请再次输入密码</label>*<input type="password"
								class="form-control" id="pwd2"  name="pwd2"
								required="required" ng-minlength="1" 
								ng-model="pwd2" /
								placeholder="请再次输入密码" required /> <span
								style="color: red"
								ng-show="myForm.pwd2.$dirty && myForm.pwd2.$invalid"> <span
								ng-show="myForm.pwd2.$error.required">密码是必须的。</span>
								<span class="warning" ng-show="myForm.pwd2.$error.required">*</span></span>
								<div ng-if="password!=pwd2">
								<span style="color: red">两次密码输入不一致</span>
</div>							
						</div>
					</div>
					<div class="row clearfix">
						<div class="col-md-12 column">
							<label for="name">电子邮箱</label>*<input type="email"
								class="form-control" id="email" ng-model="email" name="email"
								placeholder="请输入电子邮箱" required /> <span style="color: red"
								ng-show="myForm.email.$dirty && myForm.email.$invalid"> <span
								ng-show="myForm.email.$error.required">邮箱是必须的。</span> <span
								class="warning" ng-show="myForm.pwd2.$error.required">*</span> <span
								class="warning" ng-show="myForm.email.$error.email">邮箱格式不正确</span>

							</span>
						</div>
					</div>

					<div class="row clearfix">
						<div class="col-md-12 column">
							<label for="name">手机号码</label>* <input type=""
								class="form-control" id="phone" ng-model="phone" name="Phone" placeholder="请输入手机号码"
								ng-maxlength="11" ng-minlength="11" 
								ng-pattern="/^1[3|4|5|7|8][0-9]{9}$/" 
								  required /> <span style="color: red"
								ng-show="myForm.Phone.$dirty && myForm.Phone.$invalid"> <span
								class="warning" ng-show="myForm.Phone.$error.required">手机号是必须的。*</span>
								<span class="warning" ng-show="myForm.Phone.$error.maxlength" >手机数字必须为11位</span>
								<span class="warning" ng-show="myForm.Phone.$error.minlength" >手机数字必须为11位</span>
								<span class="warning" ng-show="myForm.Phone.$error.number">只能输入数字</span>
								<span class="warning" ng-show="myForm.Phone.$error.pattern">手机格式不正确</span>
							</span>
						</div>
					</div>
					
					<div class="row clearfix">
						<div class="col-md-12 column">
						<label for="name">班级</label>*
								<select class="form-control" ng-model="classNumber">
									<option value ="1">java1</option>
									<option value ="2">java2</option>
									<option value ="3">java3</option>
									<option value ="4">java4</option>
									<option value ="5">java5</option>
									
								</select>	
						</div>
					</div>
					<div class="row clearfix">
						<div class="col-md-12 column">
						<label for="name">用户类型</label>*
								<select class="form-control" ng-model="userType">
									<option value ="1">学生</option>
									<option value ="2">老师</option>
									
									
								</select>	
						</div>
					</div>

					<div class="row clearfix">
						<div class="col-md-12 column">
						<p>(注:*为必填)</p>
						<input type="submit" value="注册"  class="btn btn-success" id="btnregister" ng-click="onClickregister()">	
						<a href="/life/login.html">已有账号绑定微信</a>		<!-- 跳转到绑定openid页面 -->		
						</div>
					</div>
					
					
				</div>
				<div class="col-md-4 column"></div>
			</div>




			<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel">注册失败</h4>
						</div>
						<div class="modal-body" id="model">
							<label id="errorMsg">{{errorMsg}}</label>
						</div>
						<div class="modal-footer">

							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="button" class="btn btn-primary">提交更改</button>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal -->
			</div>
		</div>
	</form>
	<script src="/life/js/register.js">
		
	</script>
</body>
</html>